<template v-cloak>
  <el-container style="height: 100%; border: 1px solid #eee" >
    <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <div class="img">
        <img src="../../assets/images/header.png" alt="header" style="height: 60px;
    width: 15.5em;
    margin-left: -11px;"/>
      </div>

      <el-menu :default-openeds="[1]" :default-active="1">
        <el-menu-item index="1" @click="active=0">
          <template #title><i class="el-icon-message"></i>学生信息</template>
        </el-menu-item>
        <el-menu-item index="2" @click="active=4">
          <i class="el-icon-menu"></i>学分详情
        </el-menu-item>
        <el-submenu index="3" >
          <template #title><i class="el-icon-setting"></i>申请&反馈</template>
          <el-menu-item-group title="申请">
            <el-menu-item index="3-1" @click="active=2">学生申请</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group title="反馈">
            <el-menu-item index="3-2" @click="active=3">学生反馈</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 15px"></i>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item @click="active=1">个人信息</el-dropdown-item>
            </el-dropdown-menu>
<!--            <el-dropdown-menu>-->
<!--              <el-dropdown-item @click="BindStudentAccount">绑定学生账号</el-dropdown-item>-->
<!--            </el-dropdown-menu>-->
            <el-dropdown-menu>
              <el-dropdown-item @click="outLogin">退出</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
        <span style="margin-right: 15px;">{{ dataList.headername }}</span>

      </el-header>
<!--      所属学生信息列表-->
      <template v-if="active === 0">
          <student-information/>
      </template>
<!--      团支书个人信息-->
      <template v-if="active === 1">
            <el-col :span="40">
              <profile/>
            </el-col>
      </template>
<!--      所属学生申请-->
      <template v-if="active === 2"><local-students-apply/></template>
<!--      所属学生反馈-->
      <template v-if="active === 3"><local-student-feed-back/></template>
<!--      所属学生学分详情-->
      <template v-if="active === 4"><local-student-credit-record/></template>

    </el-container>
  </el-container>
</template>

<script>
import qs from 'qs';
import {computed, ref, refs, defineComponent, getCurrentInstance, onMounted, reactive, toRefs, unref} from "vue";
import Header from '../../components/header/header'
import Profile from '../manager/childComps/Profile'
import Notice from '../student/childComps/Notice'
import Course from '../student/childComps/ApplyCredit'
import Action from '../student/childComps/Action'
import LocalStudentsApply from "./childComps/LocalStudentsApply";
import LocalStudentFeedBack from "./childComps/LocalStudentFeedBack";
import StudentInformation from "./childComps/StudentInformation";
import LocalStudentCreditRecord from "./childComps/LocalStudentCreditRecord";

export default {
  // inject: ['reload'],
  data() {
    return {
      active :0
    };
  },
  components: {
    LocalStudentFeedBack,
    Header,
    Profile,
    Notice,
    Course,
    Action,
    LocalStudentsApply,
    StudentInformation,
    LocalStudentCreditRecord
  },
  setup(props) {
    const dataList = reactive({
      headername: '',
    })
    console.log("tzs"+localStorage.getItem('ManagerName'))
    dataList.headername =  localStorage.getItem('ManagerName')

    function outLogin(){
      window.location.href = 'http://localhost:8080/';
      //退出登录清除所有缓存
      localStorage.clear()
    }


    return {

      outLogin,
      dataList
    }
  }


}

</script>

<style>
[v-cloak]{display:none!important}
.el-header {
  background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}


</style>
